package com.huangliusong.desigin.pattern.behavioral.templatemethod;

/**
 * @author huangliusong
 * @since 2018/10/13
 * {@link }
 */
public abstract class ACourse {
    protected final void makeCourse(){
        this.makePPT();
        this.makeVoid();
        if (needWriteArticle()){
            this.writeArticle();
        }
        this.packageCourse();
    }

    final void makePPT(){
        System.out.println("制作ppt");
    }


    final void makeVoid(){
        System.out.println("制作视频");
    }

    final void writeArticle(){
        System.out.println("编写手记");
    }

    //钩子方法
    protected boolean needWriteArticle(){
        return false;
    }


    //包装课程
    abstract void packageCourse();


}
